
#include "push.h"

#include "eventhandlerdata.h"

Push::Push(int pinNum, int mode) {

    Pin* pushPin = this->linkNewPin(pinNum, mode);

    this->declareEvent("push");
    this->declareEvent("release");

    pushPin->registerEventHandler("down", &Push::onRelease);
    pushPin->registerEventHandler("up", &Push::onPush);
    
}

void Push::onPush(EventHandlerData ehData){
   this->fireEvent("push"); 
}

void Push::onRelease(EventHandlerData ehData){
    this->fireEvent("release");
}


